{anchor:msg_create_0}
!! Create message
Create message
!!! Constructor
!!!! new COSA.Request.Create(entity, requestId)
|| Param || Type || Description ||
| entity | [COSA.BusinessEntity|COSA Namespace#lib_businessentity_0] | Entity to create |
| requestId _(optional)_ | {{string}} | Request unique identifier (GUID) |
!!! Instance Properties
|| Param || Type || Description ||
| entity |[COSA.BusinessEntity|COSA Namespace#lib_businessentity_0] | Entity to update |
| requestId _(optional)_ | {{string}} | Request unique identifier (GUID) |
!!! Example
{code:javascript}
var name = COSA.Util.formatString('#{0}', (new Date()).getMilliseconds()),
    contact_0 = new COSA.BusinessEntity('contact', null, {
        lastname: new COSA.XrmString(name),
        emailaddress1: new COSA.XrmString(COSA.Util.formatString('{0}@mail.com', name)),
        creditlimit: new COSA.XrmMoney(100.50),
        numberofchildren: new COSA.XrmWholeNumber(2),
        creditonhold: new COSA.XrmBoolean(true),
        parentcustomerid: new COSA.EntityReference('account', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'),
        gendercode: new COSA.OptionSetValue(1),
        birthdate: new COSA.XrmDateTime(new Date()),
        address1_latitude: new COSA.XrmDouble(14.55)
    });

//message execution
(new COSA.Request.Create(contact_0)).execute(function ( r ) {
	//working with a response
});
//or
var createRequest_0 = new COSA.Request.Create(contact_0);
COSA.Core.Execute(createRequest_0, function ( r ) {
	//working with a response
});
{code:javascript}

[Back to Top|#tbl_contents_0]